I am looking for a way to get a handle on the saved version of a module. I have a module with unsaved changes and want to run a dxl to compare the unsaved module to the saved module. Currently we're comparing the unsaved (current Module) to the previous baseline. It seems DOORS will not allow me to open the same module twice; the first being in write mode and the second in read only mode.
Module m1 = current Module // Open in write mode with unsaved changes Module m2 = read(m1, false) print unsaved(m1) "" "\n" print unsaved(m2)"" "\n" ModuleVersion mv = moduleVersion(m1) m2 = load(mv, false) print unsaved(m2)"" "\n"
I was hoping that the above code would set m2 to a reloaded version of m1. I've tried to load it by converting it to a string and ModName_ but still got the same result.
Thank you, Christopher chrisroy - Fri Aug 04 10:52:52 EDT 2017 |
Re: Get Handle on Current Saved Module Not possible. There can be only one current version of a module be opened at the same time. You can only hope to find the changes made in the current edit session from the history, but you will not be able to find out whether or not the user has saved the changes and for attributes that do not generate history / change bars you will not even be able to determine if they have been changed. What is the use case? There might be other ways to accomplish what you want? Regards, Mathias |
Re: Get Handle on Current Saved Module Mathias Mamsch - Mon Aug 14 11:12:56 EDT 2017 Not possible. There can be only one current version of a module be opened at the same time. You can only hope to find the changes made in the current edit session from the history, but you will not be able to find out whether or not the user has saved the changes and for attributes that do not generate history / change bars you will not even be able to determine if they have been changed. What is the use case? There might be other ways to accomplish what you want? Regards, Mathias Mathias, Thank you very much for the response. I thought that was going to be the case. We want to load in changes to a module without saving them and report the changes between that and the module before the unsaved changes were loaded [that way we can back out without submitting changes to memory]. Currently, we have the script compare the unsaved changes state (Module current)(if there are changes) to the previous baseline. We'd like to find the differences between the module with unsaved changes to the module that was last saved. As you said, we could save the module and look in history to see the changes but we'd like to review the changes that we loaded into the module before we actually save and submit them to memory. We'd like to find/build a single DXL solution to provide this capability. Right now I'm not sure of any simple solution. Another user would be able to open the module in read only and see what exists in saved memory, which is why I thought I might be able to run the "read" or "load" functions on the module that is already open.
Regards, Christopher |
Re: Get Handle on Current Saved Module chrisroy - Mon Aug 14 11:32:06 EDT 2017 Mathias, Thank you very much for the response. I thought that was going to be the case. We want to load in changes to a module without saving them and report the changes between that and the module before the unsaved changes were loaded [that way we can back out without submitting changes to memory]. Currently, we have the script compare the unsaved changes state (Module current)(if there are changes) to the previous baseline. We'd like to find the differences between the module with unsaved changes to the module that was last saved. As you said, we could save the module and look in history to see the changes but we'd like to review the changes that we loaded into the module before we actually save and submit them to memory. We'd like to find/build a single DXL solution to provide this capability. Right now I'm not sure of any simple solution. Another user would be able to open the module in read only and see what exists in saved memory, which is why I thought I might be able to run the "read" or "load" functions on the module that is already open.
Regards, Christopher Okay, some ideas on that one: 1. You completely cache all attribute values of the module in memory - you close the module (without save) and reopen it. You compare and apply all changes (which can be awkward to program), especially with moved objects, etc. You will get new absolute numbers. bah. 2. You put a post open trigger on the module, that will cache the module contents to a file / memory. Then you compare. 3. You have the user trigger somethink like launching a "track changes" script manually to cache the module content away. Then you compare. Anything you like? Regards, Mathias
|
Re: Get Handle on Current Saved Module Mathias Mamsch - Mon Aug 14 11:39:54 EDT 2017 Okay, some ideas on that one: 1. You completely cache all attribute values of the module in memory - you close the module (without save) and reopen it. You compare and apply all changes (which can be awkward to program), especially with moved objects, etc. You will get new absolute numbers. bah. 2. You put a post open trigger on the module, that will cache the module contents to a file / memory. Then you compare. 3. You have the user trigger somethink like launching a "track changes" script manually to cache the module content away. Then you compare. Anything you like? Regards, Mathias
1) I don't think you can close a module that a DXL is running in. I really like the idea of storing the change data in memory, closing the module, reopening it, and reinstating (unsaved) the changes. We wouldn't really have to store all the data, as we would only need to capture the changes to be able to reinstate them. As for the absolute numbers, we certainly can account for that and undelete those objects that were created by the original changes. If we can get the DXL dialog to stay open or appear to stay open during this process, this sounds most promising. 2) We don't really want to cache the module contents every time we open our modules but it certainly seems like a viable option. 3) Can be done but would like to remain semi-transparent to the user. Thanks again for the work-arounds. You certainly know your stuff!
Christopher
|
Re: Get Handle on Current Saved Module chrisroy - Mon Aug 14 12:23:11 EDT 2017 1) I don't think you can close a module that a DXL is running in. I really like the idea of storing the change data in memory, closing the module, reopening it, and reinstating (unsaved) the changes. We wouldn't really have to store all the data, as we would only need to capture the changes to be able to reinstate them. As for the absolute numbers, we certainly can account for that and undelete those objects that were created by the original changes. If we can get the DXL dialog to stay open or appear to stay open during this process, this sounds most promising. 2) We don't really want to cache the module contents every time we open our modules but it certainly seems like a viable option. 3) Can be done but would like to remain semi-transparent to the user. Thanks again for the work-arounds. You certainly know your stuff!
Christopher
You can close the module, that the DXL is running in ... The DXL is not affected by that. Keep in mind that it is not trivial at all to deduct the changes done to a module. Imagine what you can do to a module:
Determining the exact actions that a user did can be cumbersome from two module states, e.g. to determine the moves when a user switched the hierarchy of two objects (from a parent of b to b parent of a). I did part of this when we made the BranchManager software, but we did not go into merging attribute definition differences, etc. That is why I would try to avoid option 1. if you can and rather go for option 2,3 and see how that performs. There are techniques for making the caching non-blocking for the user (process objects from a timer inside a GUI). Having options for the user to disable the functionality on certain modules or at all will quickly help the users to use the function only when they really want it. Regards, Mathias |
Re: Get Handle on Current Saved Module Mathias Mamsch - Tue Aug 15 03:02:18 EDT 2017 You can close the module, that the DXL is running in ... The DXL is not affected by that. Keep in mind that it is not trivial at all to deduct the changes done to a module. Imagine what you can do to a module:
Determining the exact actions that a user did can be cumbersome from two module states, e.g. to determine the moves when a user switched the hierarchy of two objects (from a parent of b to b parent of a). I did part of this when we made the BranchManager software, but we did not go into merging attribute definition differences, etc. That is why I would try to avoid option 1. if you can and rather go for option 2,3 and see how that performs. There are techniques for making the caching non-blocking for the user (process objects from a timer inside a GUI). Having options for the user to disable the functionality on certain modules or at all will quickly help the users to use the function only when they really want it. Regards, Mathias I can't believe I've never tried that before but you're right [not shocked], you can close the module that you executed the dxl from. The script we're developing doesn't report any changes to Attribute type/definitions, or access rights. Typically these are a relatively small number of changes that we want to compare. We look at changes to the object text, object headings, defined/selected attributes, figures, and tables (including cells). I can't find it at the moment but I thought there was a function you can call on an object to determine whether it's unsaved (which is probably the same function used to control the red change bars). I imagine it would be much more cumbersome to find all the changes done to a module. With our focus primarily on the object text, and selected attributes, I don't think it's too demanding to store these changes to memory, close the module, compare, and re-apply. We may even option to not re-apply them because these changes are automatically loaded using Jazz which we can simply reload (with the caveat that we lose objects that we created if not reinstated right away; while changes are stored in memory). This dialog does pose the question, are we reporting all of the important data? Right now, I'm going to let that be and wait until someone asks for that additional data (changes to attribute definitions, access rights, etc.) Thanks again for the wisdom. Respectfully, Christopher |